<template>
    <div class="all">
        <!-- <div style="text-align:center;font-size:28px;font-weight:bold;">{{$route.name}}</div> -->
        <div class="search">
            <el-form ref="form" :model="overtimeSearch" :inline="true"  size="mini">
                <el-form-item label="订单号：">
                    <el-input v-model="overtimeSearch.number" clearable placeholder="请输入订单号"></el-input>
                </el-form-item>
                <el-form-item label="用户名：">
                    <!-- <el-input v-model="overtimeSearch.user_id" clearable placeholder="请输入用户名"></el-input> -->
                    <el-select v-model="overtimeSearch.user_id" clearable>
                        <el-option v-for="item in username" :key="item.id" :label="item.user_name" :value="item.id"></el-option>
                    </el-select>
                </el-form-item>
                <!-- <el-form-item label="手机号：">
                    <el-input
                        v-model="overtimeSearch.mobilePhone"
                        maxlength="11"
                        clearable
                        placeholder="请输入手机号"
                    ></el-input>
                </el-form-item> -->
                <el-form-item label="店铺名：">
                    <!-- <el-input v-model="overtimeSearch.storeName" clearable placeholder="请输入店铺名"></el-input> -->
                    <el-select v-model="overtimeSearch.shop_id" clearable>
                        <el-option v-for="item in shopname" :key="item.id" :label="item.name" :value="item.id"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="订单日期：">
                    <el-date-picker
                        v-model="overtimeSearch.dataTime"
                        type="daterange"
                        format="yyyy-MM-dd"
                        value-format="yyyy-MM-dd"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                        :picker-options="pickerOptions"
                    ></el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="searchClick(2)">查 询</el-button>
                </el-form-item>
            </el-form>
        </div>
        <!-- <div class="btn">
            <el-button size="medium" type="primary" @click="remove()">删 除</el-button>
        </div> -->
        <div class="table">
            <!-- 表格 -->
            <el-table
                :data="overtimeTable"
                border
                height="560"
                :style="{width:screenWidth+'px'}"
                :cell-style="cellStyle"
                :header-cell-style="rowClass"
                @selection-change="allSelectionChange"
            >
                <!-- <el-table-column type="selection" width="80px"></el-table-column> -->
                <el-table-column type="index" label="序号" width="80px"></el-table-column>
                <el-table-column label="订单号" width="230px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.number }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="用户名" width="200px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.user_id | filname }}</span>
                    </template>
                </el-table-column>
                <!-- <el-table-column label="手机号" width="140px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.mobilePhone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') }}</span>
                    </template>
                </el-table-column> -->
                <!-- <el-table-column label="城市" width="120px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.city }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="车牌" width="120px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.carNumber }}</span>
                    </template>
                </el-table-column> -->
                <!-- <el-table-column label="车辆类型" width="120px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.carType }}</span>
                    </template>
                </el-table-column> -->
                <!-- <el-table-column label="店名" width="220px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.storeName }}</span>
                    </template>
                </el-table-column>-->
                <!-- <el-table-column label="消费模式" width="120px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.consumeType }}</span>
                    </template>
                </el-table-column>-->
                <el-table-column label="超时时间" width="120px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.timeout_time }}分钟</span>
                    </template>
                </el-table-column>
                <el-table-column label="超时金额" width="120px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.timeo_money }}元</span>
                    </template>
                </el-table-column>
                <!-- <el-table-column label="优惠券" width="120px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.coupon }}</span>
                    </template>
                </el-table-column>-->
                <el-table-column label="订单创建时间" width="180px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.create_time*1000 | formatDate }} {{ scope.row.create_time*1000 | formatDateBehind }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="订单状态" width="140px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.status | filstate }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="订单门店" width="150px">
                    <template slot-scope="scope">
                        <span>{{ scope.row.shop_id | filshopm }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="操作" width="120px">
                    <template slot-scope="scope">
                        <div v-if="jurisdiction.update_state === 1">
                            <span v-if="scope.row.state !== 0">交易结束</span>
                            <el-button
                                v-else
                                size="small"
                                type="warning"
                                @click="refund(scope.$index, scope.row)"
                            >退款</el-button>
                        </div>
                        <div v-else>
                            <span v-if="scope.row.state !== 0">交易结束</span>
                            <span v-else>交易中</span>
                        </div>
                        
                    </template>
                </el-table-column>
            </el-table>

            <!-- 分页 -->
            <el-pagination
                @size-change="pageCount"
                @current-change="currentPageCount"
                :current-page="currentPage"
                :page-sizes="[100, 500,1000,1500, 2000]"
                :page-size="currentCount"
                layout="prev, pager, next, jumper, sizes,total"
                :total="pageResultSize"
            ></el-pagination>
        </div>
    </div>
</template>

<script>
import "../../../static/scss/page.scss";
import utils from "../../util/request";
import {formatDate} from "../../util/time.js";
import {timetamp} from "../../util/time.js";
import {timedata} from "../../util/time.js";
var that
export default {
    data() {
        return {
            // 分页
            jurisdiction: null,
            currentPage: 1, //初始页面
            currentCount: 100, //当前页面的数据数量
            pageResultSize: 10, //表格数据总数
            screenWidth: window.innerWidth, //可视宽度
            overtimeSearch: {
                //搜索
                number: "", //订单号
                user_id: "", //用户名
                mobilePhone: "", //手机号
                storeName: "", //店铺名
                dataTime: "" //订单日期
            },
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now();
                }
            },
            username: "", //用户信息
            shopname: "", //门店信息
            overtimeTable: [
                {
                    di: 1, //洗车记录Id
                    number: "46543135431521654862", //订单号orderId
                    user_id: "愼襡", //用户名nickName
                    // mobilePhone: "17348567495", //手机号mobilePhone
                    // city: "深圳", //城市
                    // carNumber: "粤B13512", //车牌
                    timeout_time: 10, //超时时间price
                    timeo_money: 5, //超时金额price
                    create_time: "2020-07-15", //订单创建时间orderTime
                    state: 0, //订单状态state
                },
                {
                    di: 2, //洗车记录Id
                    number: "46543135431521654862", //订单号orderId
                    user_id: "亦是", //用户名nickName
                    mobilePhone: "17348567495", //手机号mobilePhone
                    // city: "深圳", //城市
                    // carNumber: "粤B746d5", //车牌
                    timeout_time: 20, //超时时间price
                    timeo_money: 10, //超时金额price
                    create_time: "2020-08-10", //订单创建时间orderTime
                    state: 1, //订单状态state
                },
                {
                    di: 3, //洗车记录Id
                    number: "46543135431521654862", //订单号orderId
                    user_id: "无畏", //用户名nickName
                    mobilePhone: "17348567495", //手机号mobilePhone
                    // city: "深圳", //城市
                    // carNumber: "粤B7s635", //车牌
                    timeout_time: 32, //超时时间price
                    timeo_money: 15, //超时金额price
                    create_time: "2020-09-14", //订单创建时间orderTime
                    state: 2, //订单状态state
                }
            ],
            selectTable: [] //选中要删除的数组
        };
    },
    filters:{
        // 用户名
        filname(id){
            if(that.username !== ""){ 
                that.username.forEach((item)=>{
                    id === item.id ? id = item.user_name : "";
                })
            }else{return}
            return id
        },
        // 店名
        filshopm(id){
            if(that.shopname !== ""){
                that.shopname.forEach((item)=>{
                    id === item.id ? id = item.name : "";
                })
            }else{return}
            return id
        },
        filstate(id){
            if(id === 0){
                id = "进行中"
            }else if(id === 1){
                id = "已完成"
            }else if(id === 2){
                id = "已退款"
            }else{return}
            return id
        },
        // 时间
		formatDate(time){
			var date = new Date(time);
			return formatDate(date, 'yyyy-MM-dd');
		},
		formatDateBehind(time){
			var date = new Date(time);
			return formatDate(date, 'hh:mm:ss')
		}
    },
    methods: {
        searchClick(num) {
            // 查询
            let data = {page:this.currentPage,list_rows:this.currentCount}
            for(var i in this.overtimeSearch) 
            this.overtimeSearch[i] !== "" && i !== "dataTime" 
            ? data[i] = this.overtimeSearch[i] : "";
            if(this.overtimeSearch.dataTime !== "" && this.overtimeSearch.dataTime !== null){  
                // data.haveTime = "1";
                data.begin = timetamp(String(this.overtimeSearch.dataTime[0]));//开始时间
                data.end = timedata(this.overtimeSearch.dataTime[1]);//结束时间))
            }
            // console.log(data)
            utils.request("/orderTimeout/list","post",JSON.stringify(data)).then(resp=>{
                console.log(resp)
                this.overtimeTable = resp.data.data;
                this.pageResultSize = resp.data.total;
                if(num === 2){
                    resp.data.total > 0
                    ? this.$message({
                        message: "为您找到"+resp.data.total+"条超时订单数据",
                        type: "success"
                    }) : this.$message("没有符合条件的订单");
                }
            })
            // let startTime, endTime;
            // console.log(this.overtimeSearch.dataTime);
            // if (!this.overtimeSearch.dataTime) {
            //     startTime = "";
            //     endTime = "";
            // } else {
            //     startTime = this.overtimeSearch.dataTime[0] + " " + "00:00:00";
            //     endTime = this.overtimeSearch.dataTime[1] + " " + "23:59:59";
            // }
            // console.log(startTime, endTime);
            // utils
            //     .request("rechargeRecords", "post", {
            //         orderId: this.overtimeSearch.number, //订单号
            //         nickName: this.overtimeSearch.user_id, //用户名
            //         mobilePhone: this.overtimeSearch.mobilePhone, //手机号
            //         storeName: this.overtimeSearch.storeName, //店铺名
            //         startTime: startTime, //开始日期时间
            //         endTime: endTime, //结束日期时间
            //         rechargeStatus:1,
            //         deleteFlag: 0, //查询存续
            //         pageStart: this.currentPage, //页面
            //         pageRequestSize: this.currentCount //请求数据数量
            //     })
            //     .then(res => {
            //         console.log(res);
            //         if (res.data.code === 20000) {
            //             let mode, state;
            //             let list = [];
            //             let data = res.data.dataList;
            //             data.forEach(item => {
            //                 if (item.mode == 0) {
            //                     mode = "普通洗";
            //                 } else if (item.mode == 1) {
            //                     mode = "精洗";
            //                 }
            //                 if (item.state == 0) {
            //                     state = "进行中";
            //                 } else if (item.state == 1) {
            //                     state = "已完成";
            //                 } else if (item.state == 2) {
            //                     state = "已退款";
            //                 }
            //                 list.push({
            //                     di: item.di, //洗车记录Id
            //                     number: item.orderId, //订单号orderId
            //                     user_id: item.nickName, //用户名nickName
            //                     mobilePhone: item.mobilePhone, //手机号mobilePhone
            //                     city: "", //城市
            //                     carNumber: "", //车牌
            //                     carType: "", //车辆类型
            //                     coupon: "", //优惠券
            //                     storeName: item.storeName, //店铺名storeName
            //                     consumeType: mode, //消费模式mode
            //                     overtime: item.price, //超时时间price
            //                     overtimePrice: "", //超时金额price
            //                     create_time: item.createTime, //订单创建时间orderTime
            //                     state: state //订单状态state
            //                 });
            //             });
            //             this.overtimeTable = list;
            //             this.pageResultSize =
            //                 res.data.pageResult.pageResultSize; //数据库总结果数
            //         } else if (res.data.code === 20004) {
            //             that.$message({
            //                 type: "error",
            //                 message: "请重新登录！"
            //             });
            //             that.$router.push("/");
            //         } else if (res.data.code === 20006) {
            //             // this.equipmentTable = [];
            //         }
            //     });
        },
        remove() {
            // 删除
            // if (this.selectTable.length != 0) {
            //     this.$confirm("此操作将删除选中的数据, 是否继续?", "删除提示", {
            //         confirmButtonText: "确定",
            //         cancelButtonText: "取消",
            //         type: "warning"
            //     })
            //         .then(data => {
            //             for (let i = 0; i < this.selectTable.length; i++) {
            //                 console.log(this.selectTable[i]);
            //                 utils
            //                     .request("record", "put", {
            //                         di: this.selectTable[i].di, //店铺id
            //                         deleteFlag: 1 //0存续 1删除
            //                     })
            //                     .then(res => {
            //                         console.log(res);
            //                         if (res.data.code == 20000) {
            //                             if (i == this.selectTable.length - 1) {
            //                                 this.$message({
            //                                     type: "success",
            //                                     message: "删除成功!",
            //                                     duration: 2000
            //                                 });
            //                                 this.searchClick();
            //                             }
            //                         }
            //                         if (res.data.code == 20004) {
            //                             this.$message({
            //                                 message: "请重新登录！",
            //                                 type: "error",
            //                                 duration: 2000
            //                             });
            //                             this.$router.push({ path: "/" });
            //                         }
            //                     });
            //             }
            //         })
            //         .catch(err => {
            //             console.log("123");
            //             this.$message({
            //                 type: "info",
            //                 message: "已取消删除"
            //             });
            //         });
            // } else {
            //     this.$message({
            //         type: "warning",
            //         message: "您还没有选中要删除的数据!",
            //         duration: 2000
            //     });
            // }
        },
        refund(index, row) {
            // 退款
            // console.log(row);
            this.$confirm('此操作将修改该文件, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                utils.request("/orderTimeout/update","post",JSON.stringify({id:row.id,state:2})).then(resp=>{
                    console.log(resp)
                    if(resp.data.code === 200){
                        this.overtimeTable[index].state = 2;
                        this.$message({
                            type: 'success',
                            message: '修改成功!'
                        });
                    }else{return}
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消修改'
                });          
            });
            // this.$prompt("是否确认申请退款？", "提示", {
            //     confirmButtonText: "确定",
            //     cancelButtonText: "取消",
            //     inputPlaceholder: "请输入确认退款"
            // })
            //     .then(({ value }) => {
            //         console.log(value);
            //         if (value == "确认退款") {
            //             let orderId = row.number; //商户订单号
            //             let price = row.consumePrice; //订单金额
            //             let refund = price; //退款金额
            //             if (refund <= price) {
            //                 console.log("123");
            //                 utils
            //                     .request(
            //                         "refund?orderId=" +
            //                             orderId +
            //                             "&totalFee=" +
            //                             price * 100 +
            //                             "&refundFee=" +
            //                             price * 100,
            //                         "post"
            //                     )
            //                     .then(res => {
            //                         console.log(res);
            //                         if (
            //                             res.data.code === 20000 &&
            //                             res.data.data.result_code == "SUCCESS"
            //                         ) {
            //                             utils
            //                                 .request("record", "put", {
            //                                     di: row.di, //店铺id
            //                                     state: 2 //0进行中 1已完成 2已退款
            //                                 })
            //                                 .then(res => {
            //                                     console.log(res);
            //                                     if (res.data.code == 20000) {
            //                                         this.$message({
            //                                             showClose: true,
            //                                             type: "success",
            //                                             message: "确认退款成功"
            //                                         });
            //                                         this.searchClick();
            //                                     }
            //                                     if (res.data.code == 20004) {
            //                                         this.$message({
            //                                             message: "请重新登录！",
            //                                             type: "error",
            //                                             duration: 2000
            //                                         });
            //                                         this.$router.push({
            //                                             path: "/"
            //                                         });
            //                                     }
            //                                 });
            //                         } else if (
            //                             res.data.code === 20000 &&
            //                             res.data.data.result_code == "FAIL"
            //                         ) {
            //                             this.$message({
            //                                 showClose: true,
            //                                 type: "error",
            //                                 message: res.data.data.err_code_des
            //                             });
            //                         } else if (res.data.code === 20000) {
            //                             this.$message({
            //                                 showClose: true,
            //                                 type: "error",
            //                                 message: res.data.msg
            //                             });
            //                         } else if (res.data.code === 20001) {
            //                             this.$message({
            //                                 showClose: true,
            //                                 type: "error",
            //                                 message: "退款出现故障"
            //                             });
            //                         }
            //                     });
            //             } else {
            //                 console.log("退款金额大于订单金额不能退款");
            //             }
            //         } else {
            //             this.$message({
            //                 showClose: true,
            //                 type: "error",
            //                 message: "输入错误"
            //             });
            //         }
            //     })
            //     .catch(() => {
            //         this.$message({
            //             showClose: true,
            //             type: "info",
            //             message: "取消输入"
            //         });
            //     });
        },
        //   表格居中
        cellStyle: function({ row, column, rowIndex, columnIndex }) {
            return "text-align:center;";
        },
        rowClass: function({ row, rowIndex }) {
            return "text-align:center;";
        },
        allSelectionChange: function(val) {
            // 获取选中的内容
            console.log(val);
            this.selectTable = val;
        },
        // 每页数据的数量
        pageCount: function(val) {
            this.currentCount = val;
            this.searchClick(1)
            // let startTime, endTime;
            // console.log(this.overtimeSearch.dataTime);
            // if (!this.overtimeSearch.dataTime) {
            //     startTime = "";
            //     endTime = "";
            // } else {
            //     startTime = this.overtimeSearch.dataTime[0] + " " + "00:00:00";
            //     endTime = this.overtimeSearch.dataTime[1] + " " + "23:59:59";
            // }
            // console.log(startTime, endTime);
            // utils
            //     .request("rechargeRecords", "post", {
            //         orderId: this.overtimeSearch.number, //订单号
            //         nickName: this.overtimeSearch.user_id, //用户名
            //         mobilePhone: this.overtimeSearch.mobilePhone, //手机号
            //         storeName: this.overtimeSearch.storeName, //店铺名
            //         startTime: startTime, //开始日期时间
            //         endTime: endTime, //结束日期时间
            //         rechargeStatus:1,
            //         deleteFlag: 0, //查询存续
            //         pageStart: this.currentPage, //页面
            //         pageRequestSize: this.currentCount //请求数据数量
            //     })
            //     .then(res => {
            //         console.log(res);
            //         if (res.data.code === 20000) {
            //             let mode, state;
            //             let list = [];
            //             let data = res.data.dataList;
            //             data.forEach(item => {
            //                 if (item.mode == 0) {
            //                     mode = "普通洗";
            //                 } else if (item.mode == 1) {
            //                     mode = "精洗";
            //                 }
            //                 if (item.state == 0) {
            //                     state = "进行中";
            //                 } else if (item.state == 1) {
            //                     state = "已完成";
            //                 } else if (item.state == 2) {
            //                     state = "已退款";
            //                 }
            //                 list.push({
            //                     di: item.di, //洗车记录Id
            //                     number: item.orderId, //订单号orderId
            //                     user_id: item.nickName, //用户名nickName
            //                     mobilePhone: item.mobilePhone, //手机号mobilePhone
            //                     city: "", //城市
            //                     carNumber: "", //车牌
            //                     carType: "", //车辆类型
            //                     coupon: "", //优惠券
            //                     storeName: item.storeName, //店铺名storeName
            //                     consumeType: mode, //消费模式mode
            //                     overtime: item.price, //超时时间price
            //                     overtimePrice: "", //超时金额price
            //                     create_time: item.createTime, //订单创建时间orderTime
            //                     state: state //订单状态state
            //                 });
            //             });
            //             this.overtimeTable = list;
            //             this.pageResultSize =
            //                 res.data.pageResult.pageResultSize; //数据库总结果数
            //         } else if (res.data.code === 20004) {
            //             that.$message({
            //                 type: "error",
            //                 message: "请重新登录！"
            //             });
            //             that.$router.push("/");
            //         } else if (res.data.code === 20006) {
            //             // this.equipmentTable = [];
            //         }
            //     });
        },
        // 点击的第几页
        currentPageCount: function(val) {
            this.currentPage = val;
            this.searchClick(1)
            // let startTime, endTime;
            // console.log(this.overtimeSearch.dataTime);
            // if (!this.overtimeSearch.dataTime) {
            //     startTime = "";
            //     endTime = "";
            // } else {
            //     startTime = this.overtimeSearch.dataTime[0] + " " + "00:00:00";
            //     endTime = this.overtimeSearch.dataTime[1] + " " + "23:59:59";
            // }
            // console.log(startTime, endTime);
            // utils
            //     .request("rechargeRecords", "post", {
            //         orderId: this.overtimeSearch.number, //订单号
            //         nickName: this.overtimeSearch.user_id, //用户名
            //         mobilePhone: this.overtimeSearch.mobilePhone, //手机号
            //         storeName: this.overtimeSearch.storeName, //店铺名
            //         startTime: startTime, //开始日期时间
            //         endTime: endTime, //结束日期时间
            //         rechargeStatus:1,
            //         deleteFlag: 0, //查询存续
            //         pageStart: this.currentPage, //页面
            //         pageRequestSize: this.currentCount //请求数据数量
            //     })
            //     .then(res => {
            //         console.log(res);
            //         if (res.data.code === 20000) {
            //             let mode, state;
            //             let list = [];
            //             let data = res.data.dataList;
            //             data.forEach(item => {
            //                 if (item.mode == 0) {
            //                     mode = "普通洗";
            //                 } else if (item.mode == 1) {
            //                     mode = "精洗";
            //                 }
            //                 if (item.state == 0) {
            //                     state = "进行中";
            //                 } else if (item.state == 1) {
            //                     state = "已完成";
            //                 } else if (item.state == 2) {
            //                     state = "已退款";
            //                 }
            //                 list.push({
            //                     di: item.di, //洗车记录Id
            //                     number: item.orderId, //订单号orderId
            //                     user_id: item.nickName, //用户名nickName
            //                     mobilePhone: item.mobilePhone, //手机号mobilePhone
            //                     city: "", //城市
            //                     carNumber: "", //车牌
            //                     carType: "", //车辆类型
            //                     coupon: "", //优惠券
            //                     storeName: item.storeName, //店铺名storeName
            //                     consumeType: mode, //消费模式mode
            //                     overtime: item.price, //超时时间price
            //                     overtimePrice: "", //超时金额price
            //                     create_time: item.createTime, //订单创建时间orderTime
            //                     state: state //订单状态state
            //                 });
            //             });
            //             this.overtimeTable = list;
            //             this.pageResultSize =
            //                 res.data.pageResult.pageResultSize; //数据库总结果数
            //         } else if (res.data.code === 20004) {
            //             that.$message({
            //                 type: "error",
            //                 message: "请重新登录！"
            //             });
            //             that.$router.push("/");
            //         } else if (res.data.code === 20006) {
            //             // this.equipmentTable = [];
            //         }
            //     });
        }
    },
    created() {
        let Base64 = require("js-base64").Base64;
        let menuarr = JSON.parse(Base64.decode(sessionStorage.getItem("menuarr")))
        for(var i=0;i<menuarr.length;i++){
            // console.log(menuarr[i].link)
            if(menuarr[i].link === this.$route.path){
                this.jurisdiction = menuarr[i]
            }else{}
        }
        utils.request("/user/list","post",JSON.stringify({page:1,list_rows:999999999})).then(resp=>{
            console.log(resp)
            this.username = resp.data.data.data;
        })
        utils.request("/shop/list","post",JSON.stringify({page:1,list_rows:999999999})).then(resp=>{
            console.log(resp)
            this.shopname = resp.data.data.data;
        })
        this.searchClick(1)

        // let data = {
        //     number:123456,
        //     user_id:64,
        //     timeout_time:8,
        //     timeo_money:1,
        //     create_time:1603712345,
        //     state:1,
        //     shop_id:13,
        // }
        // utils.request("/orderTimeout/add","post",JSON.stringify(data)).then(resp=>{
        //     console.log(resp)
        // })
        // utils
        //     .request("rechargeRecords", "post", {
        //         rechargeStatus:1,
        //         deleteFlag: 0, //查询存续
        //         pageStart: this.currentPage, //页面
        //         pageRequestSize: this.currentCount //请求数据数量
        //     })
        //     .then(res => {
        //         console.log(res);
        //         if (res.data.code === 20000) {
        //             let mode, state;
        //             let list = [];
        //             let data = res.data.dataList;
        //             data.forEach(item => {
        //                 if (item.mode == 0) {
        //                     mode = "普通洗";
        //                 } else if (item.mode == 1) {
        //                     mode = "精洗";
        //                 }
        //                 if (item.state == 0) {
        //                     state = "进行中";
        //                 } else if (item.state == 1) {
        //                     state = "已完成";
        //                 } else if (item.state == 2) {
        //                     state = "已退款";
        //                 }
        //                 list.push({
        //                     di: item.di, //洗车记录Id
        //                     number: item.orderId, //订单号orderId
        //                     user_id: item.nickName, //用户名nickName
        //                     mobilePhone: item.mobilePhone, //手机号mobilePhone
        //                     city: "", //城市
        //                     carNumber: "", //车牌
        //                     carType: "", //车辆类型
        //                     coupon: "", //优惠券
        //                     storeName: item.storeName, //店铺名storeName
        //                     consumeType: mode, //消费模式mode
        //                     topupCount: item.price, //充值次数price
        //                     topupPrice: "", //充值金额price
        //                     create_time: item.createTime, //订单创建时间orderTime
        //                     state: state //订单状态state
        //                 });
        //             });
        //             this.topupTable = list;
        //             this.pageResultSize = res.data.pageResult.pageResultSize; //数据库总结果数
        //         } else if (res.data.code === 20004) {
        //             that.$message({
        //                 type: "error",
        //                 message: "请重新登录！"
        //             });
        //             that.$router.push("/");
        //         } else if (res.data.code === 20006) {
        //             // this.equipmentTable = [];
        //         }
        //     });
    },
    computed: {},
    watch: {
        "overtimeSearch.mobilePhone"(newValue, oldValue) {
            console.log(newValue, oldValue);
        }
    },
    beforeCreate() {
        that = this;
    },
};
</script>


